package cheme.ProcessModel;

public class ParsingUtil
{
	public static boolean isOperator(String token)
	{
		return token.trim().equals("=")
		|| token.equals("+")
		|| token.equals("-")
		|| token.equals("/")
		|| token.equals("*")
		|| token.equals("^")
		|| token.equals("(")
		|| token.equals(")");
	}
	
	public static boolean isNumber(String token)
	{
		try
		{
			Double.parseDouble(token.trim());
		}
		catch(Exception e)
		{
			if(token.equals("?")) return true; // PA change. To avoid the error if ? is entered for quantity. '?' means unknown qty.
			return false;
		}
		
		return true;
	}
}
